package edu.ucsur.tp.contactcenter.forms;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.BoxLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JLabel;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.Color;
import javax.swing.JTextPane;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import java.awt.Font;
import java.awt.Dimension;
import javax.swing.ImageIcon;
import java.awt.Frame;
import javax.swing.JInternalFrame;
import javax.swing.SwingConstants;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Window.Type;
import java.awt.Toolkit;
import java.awt.Component;

public class FormAutenticacion extends JFrame {

  private JPanel contentPane;
  private JTextField txtUsuario;
  private JPasswordField txtClave;

  /**
   * Launch the application.
   */
  public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
      public void run() {
        try {
          FormAutenticacion frame = new FormAutenticacion();
          frame.setVisible(true);
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    });
  }

  /**
   * Create the frame.
   */
  public FormAutenticacion() {
  	setResizable(false);
  	setType(Type.POPUP);
  	setIconImage(Toolkit.getDefaultToolkit().getImage(FormAutenticacion.class.getResource("/edu/ucsur/tp/contactcenter/images/Businessman.png")));
    setTitle("Contact Center - Acceso");
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    setBounds(100, 100, 534, 318);
    contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(null);
    
    JLabel lblTitulo = new JLabel("Sistema de Administraci\u00F3n ContactCenter");
    lblTitulo.setFont(new Font("Tahoma", Font.BOLD, 18));
    lblTitulo.setBounds(10, 11, 411, 32);
    contentPane.add(lblTitulo);
    
    txtUsuario = new JTextField();
    txtUsuario.setBounds(358, 119, 158, 20);
    contentPane.add(txtUsuario);
    txtUsuario.setColumns(10);
    
    txtClave = new JPasswordField();
    txtClave.setBounds(358, 176, 158, 20);
    contentPane.add(txtClave);
    
    JLabel lblUsuario = new JLabel("Usuario:");
    lblUsuario.setBounds(280, 122, 68, 14);
    contentPane.add(lblUsuario);
    
    JLabel lblClave = new JLabel("Clave:");
    lblClave.setBounds(280, 179, 68, 14);
    contentPane.add(lblClave);
    
    JButton btnIngresar = new JButton("Ingresar");
    btnIngresar.addActionListener(new ActionListener() {
    	public void actionPerformed(ActionEvent e) {
    		frmMain frm = new frmMain();
    		frm.setVisible(true);
    		setVisible(false);
     	}
    });
    btnIngresar.setIcon(new ImageIcon(FormAutenticacion.class.getResource("/edu/ucsur/tp/contactcenter/images/accept.png")));
    btnIngresar.setBounds(280, 230, 118, 38);
    contentPane.add(btnIngresar);
    
    JButton btnSalir = new JButton("Cerrar");
    btnSalir.addActionListener(new ActionListener() {
    	public void actionPerformed(ActionEvent e) {
    		System.exit(0);
    	}
    });
    btnSalir.setIcon(new ImageIcon(FormAutenticacion.class.getResource("/edu/ucsur/tp/contactcenter/images/small_cancel.png")));
    btnSalir.setBounds(408, 230, 118, 38);
    contentPane.add(btnSalir);
    
    JLabel lblSubTitulo = new JLabel("Autenticaci\u00F3n del Sistema");
    lblSubTitulo.setForeground(new Color(70, 130, 180));
    lblSubTitulo.setFont(new Font("Tahoma", Font.BOLD, 13));
    lblSubTitulo.setBounds(10, 54, 216, 20);
    contentPane.add(lblSubTitulo);
    
    JLabel lblNewLabel = new JLabel("");
    lblNewLabel.setIcon(new ImageIcon(FormAutenticacion.class.getResource("/edu/ucsur/tp/contactcenter/images/logo_login2.png")));
    lblNewLabel.setBounds(10, 99, 230, 164);
    contentPane.add(lblNewLabel);
    //setFocusTraversalPolicy(new FocusTraversalOnArray(new Component[]{contentPane, lblTitulo, txtUsuario, txtClave, lblUsuario, lblClave, btnIngresar, btnSalir, lblSubTitulo, lblNewLabel}));
  }
}
